﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Krile.Forms.ConfigForm.Children.Simplized
{
    public partial class SimpleBehavior : Krile.Kernel.Control.ConfigPage
    {
        public SimpleBehavior()
        {
            InitializeComponent();
        }

        private void SimpleBehavior_Load(object sender, EventArgs e)
        {
            this.PointingNameToSelectStatus.Checked = Core.Config.Behavior.PointingNameToSelectStatus;
            this.ConfirmOnCloseTab.Checked = Core.Config.Behavior.ConfirmOnCloseTab;
            this.PlaySound.Checked = Core.Config.Notification.PlaySound;
            this.ShowBalloonOnStatusReceived.Checked = Core.Config.Notification.ShowBalloonOnStatusReceived;
            this.SendTrayOnMinimize.Checked = Core.Config.Behavior.SendTrayOnMinimize;
            this.ExitOnWindowClose.Checked = Core.Config.Behavior.ExitOnWindowClose;
            this.CheckUpdateOnStartup.Checked = Core.Config.Behavior.AutomaticUpdate;
            this.PictureSaveLimitMinutes.Value = Core.Config.Behavior.PictureSaveLimitMinutes;
            this.WheelScrollHeight.Value = Core.Config.Behavior.WheelScrollHeight;
        }

        public override void Apply()
        {
            Core.Config.Behavior.PointingNameToSelectStatus = this.PointingNameToSelectStatus.Checked;
            Core.Config.Behavior.ConfirmOnCloseTab = this.ConfirmOnCloseTab.Checked;
            Core.Config.Notification.PlaySound = this.PlaySound.Checked;
            Core.Config.Notification.ShowBalloonOnStatusReceived = this.ShowBalloonOnStatusReceived.Checked;
            Core.Config.Behavior.SendTrayOnMinimize = this.SendTrayOnMinimize.Checked;
            Core.Config.Behavior.ExitOnWindowClose = this.ExitOnWindowClose.Checked;
            Core.Config.Behavior.AutomaticUpdate = this.CheckUpdateOnStartup.Checked;
            Core.Config.Behavior.PictureSaveLimitMinutes = (int)this.PictureSaveLimitMinutes.Value;
            Core.Config.Behavior.WheelScrollHeight = (int)this.WheelScrollHeight.Value;
        }
    }
}
